import React, { Component } from 'react';
// import logo from './assets/images/logo.svg';

import Lifecycle from './components/010504/Lifecycle'
// import Header from './components/Header'
// import List from './components/List'
// import TodoList from './components/TodoList'
// import ReactForm from './components/ReactForm'

class App extends Component {
  constructor(props){
    super(props);
    this.state={
      title:'我是app组件的title',
      flag:true
    }
  }
  setFlag=()=>{
    this.setState({      
      flag:!this.state.flag
    })
  }
  setTitle=()=>{
    this.setState({      
      title:'我是app组件改变后的title'
    })
  }
  render() {
    return (
      <div className="App">
        {
          this.state.flag?<Lifecycle title={this.state.title} />:""
        }
        <br />
        <br />
        <hr />
        <br />
        <br />
        <button onClick={this.setFlag}>挂载和销毁声明周期函数组件</button>
        <br />
        <br />
        <button onClick={this.setTitle}>改变父组件title的值</button>
    </div>
    );
  }
}

export default App;
